// export default routes
// @ts-nocheck
import React from 'react';
import { Navigate } from 'react-router-dom';

import Login from '@/pages/login';
import Home from '@/pages/home';
import Example from '@/pages/example';

const LazyLoad = (path) => {
  const Component = React.lazy(() => import(`@/pages${path}`));
  return (
    <React.Suspense fallback={<>加载中...</>}>
      <Component />
    </React.Suspense>
  );
};
const routes = [
  {
    path: '/',
    exact: true,
    element: <Home />,
    children: [
      // 重定向
      {
        path: '',
        element: <Navigate to="/login" />
      },
      // example
      {
        path: 'example',
        element: <Example />
      },
      {
        //养殖板块
        path: 'cultivation',
        children: [
          {
            path: '',
            element: (
              <Navigate to="/cultivation/breeding-process/cultivate-programs"></Navigate>
            )
          },
          {
            path: 'breeding-process',
            children: [
              {
                path: 'buy-back',
                element: LazyLoad('/cultivation/breeding-process/buy-back')
              },
              {
                path: 'cultivate-programs',
                element: LazyLoad(
                  '/cultivation/breeding-process/cultivate-programs'
                )
              },
              {
                path: 'chickenhouse',
                element: LazyLoad('/cultivation/breeding-process/chickenhouse')
              },
              {
                path: 'inhenhouse',
                element: LazyLoad('/cultivation/breeding-process/inhenhouse')
              },
              {
                path: 'transfer-management',
                children: [
                  {
                    path: '',

                    element: (
                      <Navigate to="/cultivation/breeding-process/transfer-management"></Navigate>
                    )
                  },

                  {
                    path: 'distribute',
                    element: LazyLoad(
                      '/cultivation/breeding-process/transfer-management/distribute'
                    )
                  },
                  {
                    path: 'transfer-chicken',
                    element: LazyLoad(
                      '/cultivation/breeding-process/transfer-management/transfer-chicken'
                    )
                  }
                ]
              },
              {
                path: 'instore',
                element: LazyLoad('/cultivation/breeding-process/instore')
              },
              {
                path: 'feed-structure',
                element: LazyLoad(
                  '/cultivation/breeding-process/feed-structure'
                )
              },
              {
                path: 'livestock',
                element: LazyLoad('/cultivation/breeding-process/livestock')
              },
              {
                path: 'inhenhouse',
                element: LazyLoad('/cultivation/breeding-process/inhenhouse')
              },
              {
                path: 'report',
                children: [
                  {
                    path: 'day_report',
                    element: LazyLoad(
                      '/cultivation/breeding-process/report/day_report'
                    )
                  },
                  {
                    path: 'year_report',
                    element: LazyLoad(
                      '/cultivation/breeding-process/report/year_report'
                    )
                  }
                ]
              },
              {
                path: 'put',
                element: LazyLoad('/cultivation/breeding-process/put')
              },
              {
                path: 'medicine',
                children: [
                  {
                    path: 'record',
                    element: LazyLoad(
                      '/cultivation/breeding-process/medicine/record'
                    )
                  },
                  {
                    path: 'remind',
                    element: LazyLoad(
                      '/cultivation/breeding-process/medicine/remind'
                    )
                  }
                ]
              },
              {
                path: 'illness',
                children: [
                  {
                    path: 'day_illness',
                    element: LazyLoad(
                      '/cultivation/breeding-process/illness/day_illness'
                    )
                  },
                  {
                    path: 'disinfect',
                    element: LazyLoad(
                      '/cultivation/breeding-process/illness/disinfect'
                    )
                  },
                  {
                    path: 'vaccines',
                    element: LazyLoad(
                      '/cultivation/breeding-process/illness/vaccines'
                    )
                  }
                ]
              }
            ]
          },
          //饲料出入库操作
          {
            path: 'fodder-manage',
            children: [
              {
                path: 'fodder-instore',
                element: LazyLoad('/cultivation/fodder-manage/fodder-instore')
              },
              {
                path: 'fodder-outstore',
                element: LazyLoad('/cultivation/fodder-manage/fodder-outstore')
              }
            ]
          },
          {
            path: 'environmental-monitoring',
            children: [
              {
                path: 'environmental-monitoring-and-early-warning',
                children: [
                  {
                    path: '',
                    element: (
                      <Navigate to="/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning"></Navigate>
                    )
                  },
                  {
                    path: 'greenhouse-situation-monitor',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/greenhouse-situation-monitor'
                    )
                  },
                  {
                    path: 'breeding-environment-comfort-analysis',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/breeding-environment-comfort-analysis'
                    )
                  },

                  {
                    path: 'infrared-temperature-and-humidity-monitor-early-warning',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/infrared-temperature-and-humidity-monitor-early-warning'
                    )
                  },
                  {
                    path: 'barton-health-monitor',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/barton-health-monitor'
                    )
                  },
                  {
                    path: 'base-air-quality-high-sensitive-monitor',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/base-air-quality-high-sensitive-monitor'
                    )
                  },
                  {
                    path: 'broilder-individual-voluntary-position',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/environmental-monitoring-and-early-warning/broilder-individual-voluntary-position'
                    )
                  }
                ]
              },
              {
                path: 'intelligent-environmental-control',
                children: [
                  {
                    path: 'lighting-system-regulation',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/intelligent-environmental-control/lighting-system-regulation'
                    )
                  },
                  {
                    path: 'temperature-and-humidity-control',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/intelligent-environmental-control/temperature-and-humidity-control'
                    )
                  },
                  {
                    path: 'ventilation-system-regulation',
                    element: LazyLoad(
                      '/cultivation/environmental-monitoring/intelligent-environmental-control/ventilation-system-regulation'
                    )
                  },
                  {
                    paht: '',
                    element: LazyLoad('')
                  }
                ]
              },
              {
                path: 'pollutant-monitoring-and-control',
                element: LazyLoad(
                  '/cultivation/environmental-monitoring/pollutant-monitoring-and-control'
                )
              }
            ]
          },
          {
            path: 'expert-advice',
            children: [
              {
                path: 'aquaculture-technical-advice',
                element: LazyLoad(
                  '/cultivation/expert-advice/aquaculture-technical-advice'
                )
              },
              {
                path: '/cultivation/expert-advice/expert-online-questions',
                element: LazyLoad(
                  '/cultivation/expert-advice/expert-online-questions'
                )
              }
            ]
          },
          {
            //养殖基本信息
            path: 'raising-basic-information',
            children: [
              {
                //养殖人员基本信息
                path: 'breeder-information',
                children: [
                  {
                    path: 'body-monitor-report',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/breeder-information/body-monitor-report'
                    )
                  },
                  {
                    path: 'breeding-operate-record',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/breeder-information/breeding-operate-record'
                    )
                  },
                  {
                    path: 'duty-record',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/breeder-information/duty-record'
                    )
                  }
                ]
              },
              {
                //养殖数据分析
                path: 'culture-analysis',
                children: [
                  {
                    path: 'breeding-consume',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/culture-analysis/breeding-consume'
                    )
                  },
                  {
                    path: 'breeding-output',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/culture-analysis/breeding-output'
                    )
                  },
                  {
                    path: 'breeding-scale',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/culture-analysis/breeding-scale'
                    )
                  },
                  {
                    path: 'death-data',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/culture-analysis/death-data'
                    )
                  },
                  {
                    path: 'environment-data',
                    element: LazyLoad(
                      '/cultivation/raising-basic-information/culture-analysis/environment-data'
                    )
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        path: 'slaughter',
        children: [
          {
            path: '',
            element: <Navigate to="/slaughter/flowmanage/receive" />
          },

          {
            // 屠宰流程管理
            path: 'FlowManage',
            children: [
              {
                path: 'ProductionPlan',
                element: LazyLoad('/slaughter/flow-manage/production-plan')
              },
              {
                path: 'Weigh',
                element: LazyLoad('/slaughter/flow-manage/weigh')
              },
              {
                path: 'Receive',
                element: LazyLoad('/slaughter/flow-manage/receive')
              },
              {
                path: 'ChickenWeighing',
                element: LazyLoad('/slaughter/flow-manage/chicken-weighing')
              },

              {
                path: 'Packing',
                element: LazyLoad('/slaughter/flow-manage/packing')
              },
              {
                path: 'Splitrecords',
                element: LazyLoad('/slaughter/flow-manage/Split-records')
              },
              {
                path: 'Segmentation',
                element: LazyLoad('/slaughter/flow-manage/segmentation')
              }
            ]
          },
          {
            // 屠宰流程管理
            path: 'warehouse-manage',
            children: [
              {
                path: 'chicken-accessory-warehouse',
                element: LazyLoad(
                  '/slaughter/warehouse-manage/chicken-accessory-warehouse'
                )
              },
              {
                path: 'cold-warehouse',
                element: LazyLoad('/slaughter/warehouse-manage/cold-warehouse')
              },
              {
                path: 'input-warehouse-manage',
                element: LazyLoad(
                  '/slaughter/warehouse-manage/input-warehouse-manage'
                )
              },
              {
                path: 'out-warehouse-manage',
                element: LazyLoad(
                  '/slaughter/warehouse-manage/out-warehouse-manage'
                )
              },

              {
                path: 'quick-freeze-warehouse',
                element: LazyLoad(
                  '/slaughter/warehouse-manage/quick-freeze-warehouse'
                )
              }
            ]
          },
          {
            // 屠宰记录
            path: 'Paper',
            children: [
              {
                path: 'Dailypaper',
                element: LazyLoad('/slaughter/paper/daily-paper')
              },
            ]
          },
          {
            // 记录查询
            path: 'Records',
            children: [
              {
                path: 'OperatingRecord',
                element: LazyLoad('/slaughter/records/operating-record')
              },
              {
                path: 'Receipt',
                element: LazyLoad('/slaughter/records/receipt')
              }
            ]
          }
        ]
      },
      {
        // 仓库系统
        path: 'warehouse',
        children: [
          {
            path: '',
            element: (
              <Navigate to="/warehouse/warehouse-information/fodder-warehouse-information" />
            )
          },
          {
            path: 'warehouse-information',
            children: [
              {
                path: 'fodder-warehouse-information',
                element: LazyLoad(
                  '/warehouse/warehouse-information/fodder-warehouse-information'
                )
              },
              {
                path: 'slaughter-product-list',
                element: LazyLoad(
                  '/warehouse/warehouse-information/slaughter-product-list'
                )
              },
              {
                path: 'slaughter-warehouse-information',
                element: LazyLoad(
                  '/warehouse/warehouse-information/slaughter-warehouse-information'
                )
              }
            ]
          },
          {
            path: 'warehousing',
            children: [
              {
                path: 'fodder-warehousing',
                element: LazyLoad('/warehouse/warehousing/fodder-warehousing')
              },
              {
                path: 'slaughter-of-warehousing',
                element: LazyLoad(
                  '/warehouse/warehousing/slaughter-of-warehousing'
                )
              }
            ]
          }
        ]
      },
      {
        // 物流系统
        path: 'wuliu',
        children: [
          {
            path: '',
            element: (
              <Navigate to="/wuliu/Logistics-information/Vehicle-information" />
            )
          },
          {
            path: 'Logistics-information',
            children: [
              {
                path: 'Vehicle-information',
                element: LazyLoad(
                  '/wuliu/Logistics-information/Vehicle-information'
                )
              },
              {
                path: 'Start-vehicle',
                element: LazyLoad(
                  '/wuliu/Logistics-information/Start-vehicle'
                )
              },
              {
                path: 'Vehicle-Management',
                element: LazyLoad(
                  '/wuliu/Logistics-information/Vehicle-Management'
                )
              },
              {
                path: 'applicationLogistics',
                element: LazyLoad(
                  '/wuliu/Logistics-information/applicationLogistics'
                )
              },
              {
                path: 'stationLogistics',
                element: LazyLoad(
                  '/wuliu/Logistics-information/stationLogistics'
                )
              }
            ]
          },
          {
            path: 'logistics-management',
            children: [
              {
                path: 'invoice',
                element: LazyLoad('/wuliu/logistics-management/invoice')
              }
            ]
          }
        ]
      }
    ]
  },
  // {
  //   path: '/Navigation',
  //   element: <Navigation />
  // },
  {
    path: '/login',
    element: <Login />
  }
];

export default routes;
